package com.tuyrt.firstcode.module.activity

import android.content.Context
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.tuyrt.firstcode.MainActivity
import com.tuyrt.firstcode.kotlin.eg.later
import com.tuyrt.firstcode.kotlin.generics.toPage
import com.tuyrt.firstcode.kotlin.generics.toPageWithExtra
import com.tuyrt.firstcode.utils.Settings
import com.tuyrt.firstcode.utils.open

/**
 * Created by tuyrt7 on 2021/4/9.
 */
class FuncHighActivity : AppCompatActivity() {

    companion object {

    }

    val view:View by later {
        findViewById(android.R.id.content)
    }

    val str by lazy {
        "hello,world"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        getSharedPreferences("data", Context.MODE_PRIVATE).open {
            putString("name", "Jack")
            putInt("age", 18)
        }

        Settings.isFirst = false


        toPage<MainActivity>(this)
        toPageWithExtra<MainActivity>(this) {
           putExtra("key",2)
        }
    }

}